package com.woniu.darryringmall.front.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woniu.darryringmall.front.entity.Comment;
import com.woniu.darryringmall.front.entity.CommentVo;
import com.woniu.darryringmall.front.mapper.CommentMapper;
import com.woniu.darryringmall.front.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 评论表Service接口实现类
 */
@Service
public class CommentServiceImpl extends ServiceImpl<CommentMapper, Comment> implements CommentService {
    @Autowired
    private CommentMapper commentMapper;


    @Override
    public void add(Comment comment) {
        commentMapper.add(comment);
    }

    @Override
    public void del(int id) {
        commentMapper.deleteById(id);
    }


    @Override
    public List<CommentVo> getNoCmByUserId(int userId) {
        return commentMapper.getNoCmByUserId(userId);
    }

    @Override
    public List<CommentVo> getCmByUserId(int userId) {
        return commentMapper.getCmByUserId(userId);
    }

}
